package com.xuan.temper.controller;

import com.xuan.temper.entity.EchartsEntity;
import com.xuan.temper.entity.RespBean;
import com.xuan.temper.entity.ReturnData;
import com.xuan.temper.service.EchartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @创建人： king xuan
 * @创建时间：2020/9/22
 * @描述：
 */
@RestController
@RequestMapping(value = "/Echarts")
public class EchartsController {

    @Autowired
    private EchartsService echartsService;

    /**
     * [新增]
     * @author xuan
     * @date 2020/09/22
     **/
    @RequestMapping("/insert")
    public boolean insert(EchartsEntity echarts){
        return echartsService.insert(echarts);
    }

    /**
     * [刪除]
     * @author xuan
     * @date 2020/09/22
     **/
    @RequestMapping("/delete")
    public boolean delete(int id){
        return echartsService.delete(id);
    }

    /**
     * [更新]
     * @author xuan
     * @date 2020/09/22
     **/
    @RequestMapping("/update")
    public boolean update(EchartsEntity echarts){
        return echartsService.update(echarts);
    }

    /**
     * [查询] 根据主键 id 查询
     * @author xuan
     * @date 2020/09/22
     **/
    @RequestMapping("/test")
    public RespBean load(){
        List<EchartsEntity> test = echartsService.test();
        return new RespBean("200",test,"获取成功");
    }



}
